//! Minions.debug.js
//

(function() {

Type.registerNamespace('ThemeChain');

////////////////////////////////////////////////////////////////////////////////
// ThemeMinions

ThemeMinions = function ThemeMinions() {
    /// <field name="addSlideTitle" type="String" static="true">
    /// </field>
    /// <field name="nextSlideTitle" type="String" static="true">
    /// </field>
    /// <field name="prevSlideTitle" type="String" static="true">
    /// </field>
    /// <field name="remSlideTitle" type="String" static="true">
    /// </field>
    /// <field name="deleteMsg" type="String" static="true">
    /// </field>
    /// <field name="pageAddBtnTitle" type="String" static="true">
    /// </field>
    /// <field name="pageCancelBtnTitle" type="String" static="true">
    /// </field>
    /// <field name="pageAddDoneTitle" type="String" static="true">
    /// </field>
    /// <field name="_initialized$1" type="Boolean" static="true">
    /// </field>
    ThemeMinions.initializeBase(this);
}


Type.registerNamespace('Minions.Classes');

////////////////////////////////////////////////////////////////////////////////
// MiCanvas

MiCanvas = function MiCanvas(cd) {
    /// <param name="cd" type="Minions.Classes.MiCanvasData">
    /// </param>
    /// <field name="_canvasData" type="Minions.Classes.MiCanvasData">
    /// </field>
    if (cd == null) {
        cd = new Minions.Classes.MiCanvasData();
    }
    this.setData(cd);
}
MiCanvas.prototype = {
    _canvasData: null,
    
    get_canvasData: function MiCanvas$get_canvasData() {
        /// <value type="Minions.Classes.MiCanvasData"></value>
        return this._canvasData;
    },
    
    remFromCanvas: function MiCanvas$remFromCanvas(evo) {
        /// <param name="evo" type="Nsb.Classes.Evo">
        /// </param>
        var mm = evo.value;
        delete this._canvasData.minion[mm.id];
    },
    
    setData: function MiCanvas$setData(data) {
        /// <param name="data" type="Minions.Classes.MiCanvasData">
        /// </param>
        /// <returns type="MiCanvas"></returns>
        ss.Debug.assert(data != null, 'canvas data not null');
        this._canvasData = data;
        return this;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Minions.Classes.MiCanvasData

Minions.Classes.MiCanvasData = function Minions_Classes_MiCanvasData() {
    /// <field name="build" type="String">
    /// </field>
    /// <field name="css" type="Object">
    /// </field>
    /// <field name="curate" type="String">
    /// </field>
    /// <field name="embedGap" type="Number" integer="true">
    /// </field>
    /// <field name="hasBackground" type="Boolean">
    /// </field>
    /// <field name="interval" type="Number" integer="true">
    /// </field>
    /// <field name="load" type="String">
    /// </field>
    /// <field name="loadCss" type="String">
    /// </field>
    /// <field name="minion" type="Minions.Classes.MinionData">
    /// </field>
    /// <field name="slide" type="Number" integer="true">
    /// </field>
    /// <field name="style" type="String">
    /// </field>
    this.css = {};
}
Minions.Classes.MiCanvasData.prototype = {
    build: null,
    curate: null,
    embedGap: 0,
    hasBackground: false,
    interval: 5000,
    load: null,
    loadCss: null,
    minion: null,
    slide: 0,
    style: null
}


////////////////////////////////////////////////////////////////////////////////
// Minion

Minion = function Minion() {
    /// <field name="minionTypeKey" type="String" static="true">
    /// </field>
    /// <field name="minionTiltKey" type="String" static="true">
    /// </field>
    /// <field name="minionHasHeightKey" type="String" static="true">
    /// </field>
    /// <field name="minionClassName" type="String" static="true">
    /// </field>
    /// <field name="dotMinionClassName" type="String" static="true">
    /// </field>
    /// <field name="minionContentClassName" type="String" static="true">
    /// </field>
    /// <field name="dotMinionContentClassName" type="String" static="true">
    /// </field>
    /// <field name="_extractGigClassRx$3" type="RegExp" static="true">
    /// </field>
    /// <field name="_allMinions$3" type="Object" static="true">
    /// </field>
    /// <field name="children" type="Object">
    /// </field>
    /// <field name="content" type="jQueryObject">
    /// </field>
    /// <field name="id" type="String">
    /// </field>
    /// <field name="units" type="String">
    /// </field>
    /// <field name="unsaved" type="Boolean">
    /// </field>
    /// <field name="_data$3" type="Minions.Classes.MinionData">
    /// </field>
    /// <field name="_editing$3" type="Boolean">
    /// </field>
    /// <field name="_hostElement$3" type="jQueryObject">
    /// </field>
    /// <field name="_parent$3" type="Minion">
    /// </field>
    /// <field name="_partitionKey$3" type="String">
    /// </field>
    /// <field name="_rowKey$3" type="String">
    /// </field>
    /// <field name="_theCanvas$3" type="MiCanvas">
    /// </field>
    /// <field name="_topMinion$3" type="Minion">
    /// </field>
    /// <field name="cssMap" type="Object" static="true">
    /// </field>
    this.children = {};
    Minion.initializeBase(this);
    this.element = this.get__defaultHtml$3();
    this.element.data('Gig', this);
    this._topMinion$3 = this;
    this._theCanvas$3 = new MiCanvas(new Minions.Classes.MiCanvasData());
    this._hostElement$3 = $(document.body);
}
Minion.getMinionById = function Minion$getMinionById(id) {
    /// <param name="id" type="String">
    /// </param>
    /// <returns type="Minion"></returns>
    try {
        var mm = Minion._allMinions$3[id];
        if (mm == null) {
            debugger;
            return null;
        }
        return mm;
    }
    catch ($e1) {
        debugger;
        return null;
    }
}
Minion.get_count = function Minion$get_count() {
    /// <value type="Number" integer="true"></value>
    return Object.getKeyCount(Minion._allMinions$3);
}
Minion.get_all = function Minion$get_all() {
    /// <value type="Object"></value>
    return Minion._allMinions$3;
}
Minion._fixGd$3 = function Minion$_fixGd$3(md) {
    /// <param name="md" type="Minions.Classes.MinionData">
    /// </param>
    md.css = md.css || {};
    md.floated = ss.isValue(md.floated) && md.floated;
    md.embedded = ss.isValue(md.embedded) && md.embedded;
}
Minion.parseContent = function Minion$parseContent(txt) {
    /// <param name="txt" type="String">
    /// </param>
    /// <returns type="jQueryObject"></returns>
    Minion._extractGigClassRx$3.lastIndex = 0;
    var mx = Minion._extractGigClassRx$3.exec(txt);
    if (mx != null && mx.length > 1) {
        try {
            return eval('new ' + mx[1] + '().Content()');
        }
        catch (ex) {
            var s = ex.toString();
            return $('<div>' + s + '</div>');
        }
    }
    return $(txt);
}
Minion.pxStr = function Minion$pxStr(value) {
    /// <param name="value" type="String">
    /// </param>
    /// <returns type="String"></returns>
    if (value.indexOf('pt') > 0) {
        return (parseFloat(value) * 1.3333) + 'px';
    }
    if (value.indexOf('em') > 0) {
        return (parseFloat(value) * 10) + 'px';
    }
    return parseFloat(value) + 'px';
}
Minion.ptStr = function Minion$ptStr(value) {
    /// <param name="value" type="String">
    /// </param>
    /// <returns type="String"></returns>
    return Minion.pt(value) + 'pt';
}
Minion.pt = function Minion$pt(value) {
    /// <param name="value" type="String">
    /// </param>
    /// <returns type="Number"></returns>
    if (value.indexOf('pt') > 0) {
        return parseFloat(value);
    }
    if (value.indexOf('em') > 0) {
        return parseFloat(value) * 7.5;
    }
    return parseFloat(value) * 0.75;
}
Minion.emStr = function Minion$emStr(value) {
    /// <param name="value" type="String">
    /// </param>
    /// <returns type="String"></returns>
    return Minion.em(value) + 'em';
}
Minion.em = function Minion$em(value) {
    /// <param name="value" type="String">
    /// </param>
    /// <returns type="Number"></returns>
    try {
        if (value.indexOf('em') > 0) {
            return parseFloat(value);
        }
        if (value.indexOf('pt') > 0) {
            return parseFloat(value) * 0.13333;
        }
    }
    catch ($e1) {
    }
    return parseFloat(value) * 0.1;
}
Minion.prototype = {
    content: null,
    id: null,
    units: 'px',
    unsaved: false,
    _data$3: null,
    _editing$3: false,
    _hostElement$3: null,
    _parent$3: null,
    _partitionKey$3: null,
    _rowKey$3: null,
    _theCanvas$3: null,
    _topMinion$3: null,
    
    get__defaultHtml$3: function Minion$get__defaultHtml$3() {
        /// <value type="jQueryObject"></value>
        return $("<div class='" + 'Gig' + "'/>");
    },
    
    get_topMinion: function Minion$get_topMinion() {
        /// <value type="Minion"></value>
        return this._topMinion$3;
    },
    set_topMinion: function Minion$set_topMinion(value) {
        /// <value type="Minion"></value>
        this._topMinion$3 = value;
        return value;
    },
    
    get_theCanvas: function Minion$get_theCanvas() {
        /// <value type="MiCanvas"></value>
        return (this._topMinion$3 === this) ? this._theCanvas$3 : this._topMinion$3.get_theCanvas();
    },
    
    get_parent: function Minion$get_parent() {
        /// <value type="Minion"></value>
        return this._parent$3;
    },
    set_parent: function Minion$set_parent(value) {
        /// <value type="Minion"></value>
        this._parent$3 = value;
        return value;
    },
    
    get_data: function Minion$get_data() {
        /// <value type="Minions.Classes.MinionData"></value>
        return this._data$3;
    },
    set_data: function Minion$set_data(value) {
        /// <value type="Minions.Classes.MinionData"></value>
        this._data$3 = value;
        if (this._data$3 != null) {
            this.units = (this._data$3.relative) ? '%' : 'px';
        }
        return value;
    },
    
    get_liveData: function Minion$get_liveData() {
        /// <value type="Minions.Classes.MinionData"></value>
        this.get_data().minions = this.get_liveChildData();
        if (!this.get_data().relative) {
            this.get_data().offsetParentWidth = this.element.offsetParent().width();
            this.get_data().offsetParentHeight = this.element.offsetParent().height();
        }
        return this.get_data();
    },
    
    get_editing: function Minion$get_editing() {
        /// <value type="Boolean"></value>
        return (this._topMinion$3 === this) ? this._editing$3 : this.get_topMinion().get_editing();
    },
    set_editing: function Minion$set_editing(value) {
        /// <value type="Boolean"></value>
        if (this._topMinion$3 === this) {
            this._editing$3 = value;
        }
        else {
            this._topMinion$3.set_editing(value);
        }
        return value;
    },
    
    get_partitionKey: function Minion$get_partitionKey() {
        /// <value type="String"></value>
        try {
            return this._partitionKey$3 || this._topMinion$3.get_partitionKey();
        }
        catch ($e1) {
            return null;
        }
    },
    
    get_rowKey: function Minion$get_rowKey() {
        /// <value type="String"></value>
        try {
            return this._rowKey$3 || this._topMinion$3.get_rowKey();
        }
        catch ($e1) {
            return null;
        }
    },
    
    get_liveChildData: function Minion$get_liveChildData() {
        /// <value type="Object"></value>
        var minions = {};
        if (Object.getKeyCount(this.children) > 0) {
            var $dict1 = this.children;
            for (var $key2 in $dict1) {
                var pair = { key: $key2, value: $dict1[$key2] };
                minions[pair.key] = pair.value.get_liveData();
            }
        }
        return minions;
    },
    
    get_hostElement: function Minion$get_hostElement() {
        /// <value type="jQueryObject"></value>
        return (this._parent$3 != null) ? this._parent$3.element : this._hostElement$3;
    },
    
    destroy: function Minion$destroy() {
        this.element.removeData('Gig').removeData('gigType').removeData('gigTilt').removeData('gigHasHeight').remove();
        delete Minion._allMinions$3[this.id];
        if (this.get_parent() != null) {
            delete this.get_parent().children[this.id];
            this.get_parent().set_data(this.get_parent().get_liveData());
        }
        var $dict1 = this.children;
        for (var $key2 in $dict1) {
            var pair = { key: $key2, value: $dict1[$key2] };
            pair.value.destroy();
        }
        this.children = null;
        this.set_data(null);
        this.content = null;
        this._parent$3 = null;
        this._editing$3 = false;
    },
    
    draggable: function Minion$draggable() {
    },
    
    droppable: function Minion$droppable() {
    },
    
    newMinion: function Minion$newMinion(top) {
        /// <param name="top" type="Minion">
        /// </param>
        /// <returns type="Minion"></returns>
        return new Minion().setTop(top);
    },
    
    deleteMinion: function Minion$deleteMinion(immediate) {
        /// <param name="immediate" type="Boolean">
        /// </param>
        if (immediate) {
            this._deleteNow$3();
        }
        else {
            new Await().addAw(ss.Delegate.create(new Ask(), new Ask().okCancelAw), ThemeYoshi.forSure).addAw(DomElement.requireResultAw, true).addDx(ss.Delegate.create(this, function() {
                this._deleteNow$3();
            })).commit();
        }
    },
    
    _deleteNow$3: function Minion$_deleteNow$3() {
        this.destroy();
    },
    
    mapCss: function Minion$mapCss(gd, el, css) {
        /// <summary>
        /// Apply css to gig adding other css stuff too (needs better doc)
        /// </summary>
        /// <param name="gd" type="Minions.Classes.MinionData">
        /// gig data
        /// </param>
        /// <param name="el" type="jQueryObject">
        /// page element
        /// </param>
        /// <param name="css" type="Object">
        /// css to apply
        /// </param>
        css = this.onTheFlyCss(css, el);
        var opt = Minion.cssMap[gd.type];
        if (opt == null) {
            el.css(css);
            return;
        }
        var sel = $(opt.inner, el);
        if (sel.length > 0) {
            var bw = Css.borderWidth(gd.css);
            if (opt.rounding) {
                var br = parseFloat((gd.css['border-radius'] || 0).toString());
                br = Math.max(br - bw, 0);
                var rds = (this.get_data().relative) ? Minion.emStr(br) : br + 'px';
                sel.css({ '-moz-border-radius': rds, '-webkit-border-radius': rds, 'border-radius': rds });
            }
            if (opt.css) {
                var wd = Css.paddingHorz(gd.css) + (bw * 2);
                var ht = Css.paddingVert(gd.css) + (bw * 2);
                sel.css(css);
                sel.css({ width: gd.dim.width - wd + this.units, height: gd.dim.height - ht + this.units });
            }
            else {
                el.css(css);
            }
        }
        else {
            el.css(css);
        }
    },
    
    absoluteParent: function Minion$absoluteParent() {
        /// <returns type="Minion"></returns>
        var mm = this;
        while (mm != null && mm.get_data().relative) {
            mm = mm.get_parent();
        }
        return mm;
    },
    
    onTheFlyCss: function Minion$onTheFlyCss(orgCss, el) {
        /// <param name="orgCss" type="Object">
        /// </param>
        /// <param name="el" type="jQueryObject">
        /// </param>
        /// <returns type="Object"></returns>
        var css = {};
        var $dict1 = orgCss;
        for (var $key2 in $dict1) {
            var pair = { key: $key2, value: $dict1[$key2] };
            var wfx = 100 / this.get_data().offsetParentWidth;
            var ap = this.absoluteParent();
            var apEm1 = (10 / parseFloat(ap.element.css('font-size') || '10px')) / 10;
            if (this.get_data().relative) {
                if ((/^(padding|margin)/).test(pair.key)) {
                    css[pair.key] = parseFloat(pair.value) * wfx + '%';
                }
                else if (pair.key.indexOf('-radius') !== -1) {
                    css[pair.key] = parseFloat(pair.value) * 0.1 + 'em';
                }
                else if (pair.key === 'border-width') {
                    var v = parseFloat(pair.value) * 0.1;
                    css[pair.key] = (v < apEm1) ? '1px' : (v + 'em');
                }
                else {
                    css[pair.key] = pair.value;
                }
            }
            else {
                css[pair.key] = pair.value;
            }
        }
        if (this.get_data().relative) {
            css['font-size'] = (this.get_data().hasFont) ? Minion.emStr(css['font-size'] || '10px') : '1em';
        }
        else {
            css['font-size'] = (this.get_data().hasFont) ? Minion.pxStr(css['font-size'] || '10px') : Minion.emStr(this.get_data().dim.width * 0.1);
        }
        return css;
    },
    
    doAction: function Minion$doAction(action, arg1, arg2) {
        /// <param name="action" type="String">
        /// </param>
        /// <param name="arg1" type="Object">
        /// </param>
        /// <param name="arg2" type="Object">
        /// </param>
        try {
            var fn = eval(action.trim());
            fn(arg1, arg2);
        }
        catch (ex) {
            Inform.error('Do action error: {0}: {1}', action, ex);
        }
    },
    
    rePaint: function Minion$rePaint(evo) {
        /// <param name="evo" type="Nsb.Classes.Evo">
        /// </param>
        var mm = this.clone();
        var placeholder = $('<div/>').insertAfter(this.element);
        this.destroy();
        mm.addTo(mm.get_parent()).paint();
        mm.element.insertBefore(placeholder);
        placeholder.remove();
    },
    
    rePaintCanvas: function Minion$rePaintCanvas(evo) {
        /// <param name="evo" type="Nsb.Classes.Evo">
        /// </param>
        this.get_topMinion().rePaint(evo);
    },
    
    show: function Minion$show(evo) {
        /// <param name="evo" type="Nsb.Classes.Evo">
        /// </param>
        this.element.show();
    },
    
    hide: function Minion$hide(evo) {
        /// <param name="evo" type="Nsb.Classes.Evo">
        /// </param>
        this.element.hide();
    },
    
    setData: function Minion$setData(md) {
        /// <param name="md" type="Minions.Classes.MinionData">
        /// </param>
        /// <returns type="Minion"></returns>
        this.set_data(md);
        this.setId(md.id || Formulas.get_newId());
        return this;
    },
    
    setTop: function Minion$setTop(mm) {
        /// <param name="mm" type="Minion">
        /// </param>
        /// <returns type="Minion"></returns>
        ss.Debug.assert(this.get_parent() == null, 'Parent must be null');
        this.set_topMinion(mm);
        var $dict1 = this.children;
        for (var $key2 in $dict1) {
            var pair = { key: $key2, value: $dict1[$key2] };
            pair.value.setTop(mm);
        }
        return this;
    },
    
    setAsCanvas: function Minion$setAsCanvas(cv) {
        /// <param name="cv" type="MiCanvas">
        /// </param>
        /// <returns type="Minion"></returns>
        ss.Debug.assert(this.get_parent() == null, 'Parent must be null');
        this._theCanvas$3 = cv;
        this.setTop(this);
        return this;
    },
    
    setHost: function Minion$setHost(el) {
        /// <param name="el" type="jQueryObject">
        /// </param>
        /// <returns type="Minion"></returns>
        this._hostElement$3 = el;
        return this;
    },
    
    setDb: function Minion$setDb(partitionKey, rowKey) {
        /// <param name="partitionKey" type="String">
        /// </param>
        /// <param name="rowKey" type="String">
        /// </param>
        /// <returns type="Minion"></returns>
        this._partitionKey$3 = partitionKey;
        this._rowKey$3 = rowKey;
        return this;
    },
    
    addTo: function Minion$addTo(parent) {
        /// <param name="parent" type="Minion">
        /// </param>
        /// <returns type="Minion"></returns>
        ss.Debug.assert(!String.isNullOrEmpty(this.id) && this.get_data() != null, 'has Data && Id');
        this._parent$3 = parent;
        if (parent != null) {
            parent.children[this.id] = this;
        }
        return this;
    },
    
    clone: function Minion$clone() {
        /// <returns type="Minion"></returns>
        var mm = this.newMinion(this.get_topMinion());
        mm.setData(JSON.parse(JSON.stringify(this.get_liveData()))).setHost(this.get_hostElement()).setDb(this._partitionKey$3, this._rowKey$3).setTop((this.get_topMinion() === this) ? mm : this.get_topMinion()).setAsCanvas(this.get_theCanvas());
        mm._theCanvas$3 = this.get_theCanvas();
        return mm;
    },
    
    loadFrom: function Minion$loadFrom(partitionKey, rowKey) {
        /// <param name="partitionKey" type="String">
        /// </param>
        /// <param name="rowKey" type="String">
        /// </param>
        /// <returns type="Minion"></returns>
        return this;
    },
    
    setId: function Minion$setId(id) {
        /// <param name="id" type="String">
        /// </param>
        /// <returns type="Minion"></returns>
        this.id = id || this.id;
        ss.Debug.assert(this.get_data() != null, 'Data != null');
        this.get_data().id = this.id;
        ss.Debug.assert(this.element != null, 'Element != null');
        this.element.attr('id', this.id);
        return this;
    },
    
    appendTo: function Minion$appendTo(el) {
        /// <param name="el" type="jQueryObject">
        /// </param>
        /// <returns type="Minion"></returns>
        this.element.appendTo(el);
        return this;
    },
    
    addClass: function Minion$addClass(cls) {
        /// <param name="cls" type="String">
        /// </param>
        /// <returns type="Minion"></returns>
        if (!String.isNullOrEmpty(cls)) {
            this.element.addClass(cls);
        }
        return this;
    },
    
    addAttr: function Minion$addAttr(attr) {
        /// <param name="attr" type="Object">
        /// </param>
        /// <returns type="Minion"></returns>
        if (attr != null && Object.getKeyCount(attr) > 0) {
            this.element.attr(attr);
        }
        return this;
    },
    
    addType: function Minion$addType(type) {
        /// <param name="type" type="String">
        /// </param>
        /// <returns type="Minion"></returns>
        if (!String.isNullOrEmpty(type)) {
            this.element.data('gigType', type);
        }
        return this;
    },
    
    fromHtml: function Minion$fromHtml(html) {
        /// <param name="html" type="String">
        /// </param>
        /// <returns type="Minion"></returns>
        this.content = $(html).prependTo(this.element);
        return this;
    },
    
    fromElement: function Minion$fromElement(el) {
        /// <param name="el" type="jQueryObject">
        /// </param>
        /// <returns type="Minion"></returns>
        this.content = el;
        el.prependTo(this.element);
        return this;
    },
    
    addTilt: function Minion$addTilt(deg) {
        /// <param name="deg" type="Number">
        /// </param>
        /// <returns type="Minion"></returns>
        this.element.data('gigTilt', deg);
        this.element[0].tilt = deg;
        this.element.rotate({ angle: deg });
        return this;
    },
    
    addHasHeight: function Minion$addHasHeight(has) {
        /// <param name="has" type="Boolean">
        /// </param>
        /// <returns type="Minion"></returns>
        this.element.data('gigHasHeight', has);
        return this;
    },
    
    paint: function Minion$paint() {
        /// <returns type="Minion"></returns>
        this.injectIntoPage();
        Minion._allMinions$3[this.id] = this;
        return this;
    },
    
    injectIntoPage: function Minion$injectIntoPage() {
        /// <summary>
        /// Workhorse builds passed Minion into a jQueryObect and inserts it into the page.
        /// </summary>
        /// <returns type="Minion"></returns>
        ss.Debug.assert(this.get_data() != null, 'Data != null');
        this.element.data('Gig', this);
        this.setId(this.get_data().id);
        Minion._fixGd$3(this.get_data());
        var where = this.get_hostElement();
        if (!!where.length) {
            var content = Minion.parseContent(this.get_data().html);
            this.fromElement(content).addClass(this.get_data().classNames).addAttr(this.get_data().attributes).addType(this.get_data().type).addHasHeight(this.get_data().hasHeight);
            var iel = this.element.find(Minion.dotMinionContentClassName);
            if (iel.length > 0) {
                if (!String.isNullOrEmpty(this.get_data().iid)) {
                    iel.attr('id', this.get_data().iid);
                }
                if (!String.isNullOrEmpty(this.get_data().iclass)) {
                    iel.addClass(this.get_data().iclass);
                }
            }
            this.appendTo(where);
            this.paintMetrics(true);
            this.addTilt(this.get_data().tilt);
            this.draggable();
            this.droppable();
            if (this.get_data().minions != null) {
                var $dict1 = this.get_data().minions;
                for (var $key2 in $dict1) {
                    var pair = { key: $key2, value: $dict1[$key2] };
                    this.newMinion(this.get_topMinion()).setData(pair.value).addTo(this).paint();
                }
            }
        }
        else {
            throw new Error(Exceptions.format(Exceptions.missingDomElement, Exceptions.fn(arguments)));
        }
        return this;
    },
    
    paintMetrics: function Minion$paintMetrics(noChildren) {
        /// <param name="noChildren" type="Boolean">
        /// </param>
        /// <returns type="Minion"></returns>
        var units = (this.get_data().relative) ? 'em' : this.units;
        var tp = this.get_data().pos.top;
        var lf = this.get_data().pos.left;
        var wd = this.get_data().dim.width;
        var ht = this.get_data().dim.height;
        if (this.get_data().relative) {
            tp *= 0.1;
            lf *= 0.1;
            wd *= 0.1;
            ht *= 0.1;
        }
        this.element.css({ position: 'absolute', top: tp + units, left: lf + units, width: wd + units });
        if (this.get_data().hasHeight) {
            this.element.css({ height: ht + units });
        }
        this.mapCss(this.get_data(), this.element, this.get_data().css);
        Inform.debug('PaintMetrics id --------- {0} ------------------------------------------', this.id);
        Inform.debug('PaintMetrics units=em, tp={0}, lf={1}, wd={2}, ht={3}', tp, lf, wd, ht);
        Inform.debug('PaintMetrics units=px, tp={0}, lf={1}, wd={2}, ht={3}', this.element.position().top, this.element.position().left, this.element.width(), this.element.height());
        if (!noChildren) {
            var $dict1 = this.children;
            for (var $key2 in $dict1) {
                var pair = { key: $key2, value: $dict1[$key2] };
                pair.value.paintMetrics();
            }
        }
        return this;
    },
    
    paintMetricsPercent: function Minion$paintMetricsPercent(noChildren) {
        /// <param name="noChildren" type="Boolean">
        /// </param>
        /// <returns type="Minion"></returns>
        var tp = this.get_data().pos.top;
        var lf = this.get_data().pos.left;
        var wd = this.get_data().dim.width;
        var ht = this.get_data().dim.height;
        if (this.get_data().relative) {
            var fh = 100 / this.get_data().offsetParentWidth;
            var fv = 100 / this.get_data().offsetParentHeight;
            tp *= fv;
            lf *= fh;
            wd *= fh;
            ht *= fv;
        }
        this.element.css({ position: 'absolute', top: tp + this.units, left: lf + this.units, width: wd + this.units });
        if (this.get_data().hasHeight) {
            this.element.css({ height: ht + this.units });
        }
        this.mapCss(this.get_data(), this.element, this.get_data().css);
        if (!noChildren) {
            var $dict1 = this.children;
            for (var $key2 in $dict1) {
                var pair = { key: $key2, value: $dict1[$key2] };
                pair.value.paintMetrics();
            }
        }
        return this;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Minions.Classes.MinionData

Minions.Classes.MinionData = function Minions_Classes_MinionData() {
    /// <field name="actions" type="Minions.Classes.MinionActions">
    /// </field>
    /// <field name="attributes" type="Object">
    /// </field>
    /// <field name="autosize" type="Boolean">
    /// </field>
    /// <field name="build" type="String">
    /// </field>
    /// <field name="classNames" type="String">
    /// </field>
    /// <field name="clusterId" type="String">
    /// </field>
    /// <field name="cornerRadius" type="Number" integer="true">
    /// </field>
    /// <field name="css" type="Object">
    /// </field>
    /// <field name="data" type="Object">
    /// </field>
    /// <field name="dim" type="Minions.Classes.Dimension">
    /// </field>
    /// <field name="embedded" type="Boolean">
    /// </field>
    /// <field name="floated" type="Boolean">
    /// </field>
    /// <field name="groupId" type="String">
    /// </field>
    /// <field name="hasHeight" type="Boolean">
    /// </field>
    /// <field name="help" type="Object">
    /// </field>
    /// <field name="html" type="String">
    /// </field>
    /// <field name="iclass" type="String">
    /// </field>
    /// <field name="id" type="String">
    /// </field>
    /// <field name="iid" type="String">
    /// </field>
    /// <field name="listType" type="String">
    /// </field>
    /// <field name="load" type="String">
    /// </field>
    /// <field name="minions" type="Object">
    /// </field>
    /// <field name="noCover" type="Boolean">
    /// </field>
    /// <field name="offsetParentWidth" type="Number">
    /// </field>
    /// <field name="offsetParentHeight" type="Number">
    /// </field>
    /// <field name="parentId" type="String">
    /// </field>
    /// <field name="pos" type="Minions.Classes.Pos">
    /// </field>
    /// <field name="relative" type="Boolean">
    /// </field>
    /// <field name="selecTo" type="String">
    /// </field>
    /// <field name="tilt" type="Number">
    /// </field>
    /// <field name="type" type="String">
    /// </field>
    /// <field name="hasFont" type="Boolean">
    /// </field>
    this.css = {};
    this.dim = new Minions.Classes.Dimension();
    this.id = Formulas.get_newId();
    this.pos = new Minions.Classes.Pos();
}
Minions.Classes.MinionData.prototype = {
    actions: null,
    attributes: null,
    autosize: false,
    build: null,
    classNames: '',
    clusterId: null,
    cornerRadius: 0,
    data: null,
    embedded: false,
    floated: false,
    groupId: null,
    hasHeight: false,
    help: null,
    html: null,
    iclass: null,
    iid: null,
    listType: null,
    load: null,
    minions: null,
    noCover: false,
    offsetParentWidth: 0,
    offsetParentHeight: 0,
    parentId: null,
    relative: false,
    selecTo: null,
    tilt: 0,
    type: null,
    hasFont: false
}


////////////////////////////////////////////////////////////////////////////////
// Minions.Classes.MinionActions

Minions.Classes.MinionActions = function Minions_Classes_MinionActions() {
    /// <field name="paste" type="String">
    /// </field>
    /// <field name="place" type="String">
    /// </field>
}
Minions.Classes.MinionActions.prototype = {
    paste: null,
    place: null
}


////////////////////////////////////////////////////////////////////////////////
// Minions.Classes.Pos

Minions.Classes.Pos = function Minions_Classes_Pos() {
    /// <field name="left" type="Number">
    /// </field>
    /// <field name="top" type="Number">
    /// </field>
}
Minions.Classes.Pos.clone = function Minions_Classes_Pos$clone(p) {
    /// <param name="p" type="Minions.Classes.Pos">
    /// </param>
    /// <returns type="Minions.Classes.Pos"></returns>
    var pos = new Minions.Classes.Pos();
    pos.top = p.top;
    pos.left = p.left;
    return pos;
}
Minions.Classes.Pos.prototype = {
    left: 0,
    top: 0
}


////////////////////////////////////////////////////////////////////////////////
// Minions.Classes.Dimension

Minions.Classes.Dimension = function Minions_Classes_Dimension() {
    /// <field name="height" type="Number">
    /// </field>
    /// <field name="width" type="Number">
    /// </field>
}
Minions.Classes.Dimension.prototype = {
    height: 0,
    width: 0
}


////////////////////////////////////////////////////////////////////////////////
// Minions.Classes.MinionShowConfig

Minions.Classes.MinionShowConfig = function Minions_Classes_MinionShowConfig() {
    /// <field name="css" type="Boolean">
    /// </field>
    /// <field name="doubleclick" type="Boolean">
    /// </field>
    /// <field name="inner" type="String">
    /// </field>
    /// <field name="rounding" type="Boolean">
    /// </field>
}
Minions.Classes.MinionShowConfig.prototype = {
    css: false,
    doubleclick: false,
    inner: null,
    rounding: false
}


ThemeMinions.registerClass('ThemeMinions', ThemeBase);
MiCanvas.registerClass('MiCanvas');
Minions.Classes.MiCanvasData.registerClass('Minions.Classes.MiCanvasData');
Minion.registerClass('Minion', Actor);
Minions.Classes.MinionData.registerClass('Minions.Classes.MinionData');
Minions.Classes.MinionActions.registerClass('Minions.Classes.MinionActions');
Minions.Classes.Pos.registerClass('Minions.Classes.Pos');
Minions.Classes.Dimension.registerClass('Minions.Classes.Dimension');
Minions.Classes.MinionShowConfig.registerClass('Minions.Classes.MinionShowConfig');
ThemeMinions.addSlideTitle = 'Add a slide';
ThemeMinions.nextSlideTitle = 'Next slide';
ThemeMinions.prevSlideTitle = 'Previous slide';
ThemeMinions.remSlideTitle = 'Remove this slide';
ThemeMinions.deleteMsg = 'Delete this slide for sure?';
ThemeMinions.pageAddBtnTitle = 'add new page';
ThemeMinions.pageCancelBtnTitle = 'cancel page changes';
ThemeMinions.pageAddDoneTitle = 'apply changes';
ThemeMinions._initialized$1 = Helpers.staticInheritClass((ThemeMinions).get_name(), (ThemeBase).get_name());
Minion.minionTypeKey = 'gigType';
Minion.minionTiltKey = 'gigTilt';
Minion.minionHasHeightKey = 'gigHasHeight';
Minion.minionClassName = 'Gig';
Minion.dotMinionClassName = '.' + 'Gig';
Minion.minionContentClassName = 'GigC';
Minion.dotMinionContentClassName = '.' + 'GigC';
Minion._extractGigClassRx$3 = new RegExp('<gigclass:\\s*(.*)\\s*/>', 'g');
Minion._allMinions$3 = {};
Minion.cssMap = { Button: { inner: 'button', rounding: false, css: true, doubleclick: true }, TextBox: { inner: 'input[type=text]', rounding: true, css: true, doubleclick: true }, TextArea: { inner: 'textarea', rounding: true, css: true, doubleclick: true }, TextItem: { inner: Minion.dotMinionContentClassName, rounding: true, css: false, doubleclick: true }, DropImage: { inner: 'img', rounding: true, css: false, doubleclick: false } };
})();

//! This script was generated using Script# v0.7.4.0
